﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class CustomExample : System.Web.UI.MobileControls.MobilePage
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Command1_Click(object sender, System.EventArgs e)
    {
        if (Page.IsValid)
        {
            ActiveForm = Form2;
        }
    }

    protected void ServerValidate(object source, ServerValidateEventArgs args)
    {
        args.IsValid = false;
        try
        {
            int x = Int32.Parse(number.Text);
            if (x % 4 == 0)
            {
                args.IsValid = true;
            }
        }
        catch (FormatException e)
        {
            // Exception may be caused by
            // non-integer input on HTML clients
        }
    }
}